#!/bin/bash
#yum update -y
#yum install wget -y
#mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
#wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
#yum clean all
#yum makecache
#yum install telnet net-tools ntp epel-release container-selinux -y
#systemctl enable ntpd
#systemctl start ntpd
#ntpdate cn.pool.ntp.org
sudo yum install -y yum-utils \
  device-mapper-persistent-data \
  lvm2
sudo yum-config-manager \
  --add-repo \
  http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum -y install docker-ce-18.09.0 docker-ce-cli-18.09.0
sudo systemctl enable docker.service
mkdir -p /data/docker/data-root
mkdir -p /etc/docker
cat > /etc/docker/daemon.json <<EOF
{
  "data-root": "/data/docker/data-root",
  "registry-mirrors" : [
    "https://6zy5kcio.mirror.aliyuncs.com"
  ]
}
EOF
systemctl enable docker && systemctl restart docker